﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    //将 Book 类中的属性和方法更改为静态的
    class Book2
    {
        public static int Id { get; set; }
        public static string Name { get; set; }
        public static double Price { get; set; }
        public static void SetBook(int id, string name, double price)
        {
            Id = id;
            Name = name;
            Price = price;
        }
        public static void PrintMsg()
        {
            Console.WriteLine("图书编号：" + Id);
            Console.WriteLine("图书名称：" + Name);
            Console.WriteLine("图书价格：" + Price);
        }
    }
}
